<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>修改个人信息 - 学生意见管理系统</title>
    <!-- 引入网站头部 -->
    <div th:replace="~{include/all_include::title}"/>
    <link rel="stylesheet" th:href="@{/common/resource/bootstrapvalidator/css/form-validation.css}">
    <script type="text/javascript" th:src="@{/common/resource/bootstrapvalidator/js/form-validation.js}"></script>
    <script language="javascript" type="text/javascript" th:src="@{/common/resource/My97DatePicker/WdatePicker.js}"></script>
    <script type="text/javascript">
        $(function()
        {
            $("#form").FormValidation({
                fields:
                    {
                        /* qq */
                        qq:
                            {
                                validators: {
                                    notEmpty: {
                                        message: 'qq不能为空'
                                    },
                                    stringLength: {
                                        min: 4,
                                        max:40,
                                        message: 'qq的长度为在4位与40位之间'
                                    },
                                    regexp: {
                                        regexp: /^[\d]+$/i,
                                        message: 'qq不符合规则'
                                    }
                                }
                            },
                        phone:
                            {
                                validators: {
                                    notEmpty: {
                                        message: '手机号不能为空'
                                    },
                                    stringLength: {
                                        min: 11,
                                        max:11,
                                        message: '手机号的长度为在11位'
                                    },
                                    regexp: {
                                        regexp: /^[\d]{11}$/i,
                                        message: '手机号不符合规则'
                                    }
                                }
                            },
                        weiXin:
                            {
                                validators: {
                                    notEmpty: {
                                        message: '微信不能为空'
                                    },
                                    stringLength: {
                                        min: 2,
                                        max:20,
                                        message: '微信的长度为在2--20位'
                                    }
                                }
                            }
                    }
            });
        });
    </script>
</head>
<body>
<div th:replace="~{include/all_include::header}"/>
<!-- 网页的主体 -->
<div class="container">
    <div class="col-md-8 col-sm-10">
        <form id="form" method="post" class="form-horizontal" th:action="@{/head/users/usersUpdateSubmit}">
            <input type="hidden" name="operType" th:value="${param.operType}">
            <h2 class="col-sm-10 col-sm-offset-1 form-signin-heading text-center">修改个人信息</h2>
            <div class="form-group">
                <label for="email" class="col-sm-3 control-label">邮箱</label>
                <div class="col-sm-8">
                    <input type="text" name="email" id="email" th:value="${response.data.one?.email }"
                           class="form-control" placeholder="邮箱" />
                </div>
            </div>
            <div class="form-group">
                <label for="inputPassword" class="col-sm-3 control-label">昵称</label>
                <div class="col-sm-8">
                    <input type="text" name="nickName" id="nickName" th:value="${response.data.one?.nickName }"
                           class="form-control" placeholder="昵称" />
                </div>
            </div>
            <div class="form-group">
                <label for="inputPassword" class="col-sm-3 control-label">真实姓名</label>
                <div class="col-sm-8">
                    <input type="text" name="trueName" id="trueName" th:value="${response.data.one?.trueName }"
                           class="form-control" placeholder="真实姓名" />
                </div>
            </div>
            <div class="form-group">
                <label for="inputPassword" class="col-sm-3 control-label">qq</label>
                <div class="col-sm-8">
                    <input type="text" name="qq" id="qq" th:value="${response.data.one?.qq }"
                           class="form-control" placeholder="qq" />
                </div>
            </div>
            <div class="form-group">
                <label for="inputPassword" class="col-sm-3 control-label">手机</label>
                <div class="col-sm-8">
                    <input type="text" name="phone" id="phone" th:value="${response.data.one?.phone }"
                           class="form-control" placeholder="手机" />
                </div>
            </div>
            <div class="form-group">
                <label for="inputPassword" class="col-sm-3 control-label">微信</label>
                <div class="col-sm-8">
                    <input type="text" name="weiXin" id="weiXin" th:value="${response.data.one?.weiXin }"
                           class="form-control" placeholder="微信" />
                </div>
            </div>
            <div class="form-group">
                <label for="inputPassword" class="col-sm-3 control-label">生日</label>
                <div class="col-sm-8">
                    <input type="text" name="birthdayStr" id="birthdayStr" th:value="${response.data.one?.birthday}" readonly="readonly"
                           onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"
                           class="form-control"/>
                </div>
            </div>
            <div class="form-group">
                <label for="inputPassword" class="col-sm-3 control-label">性别</label>
                <div class="col-sm-8">
                    <div class="form-check form-check-inline">
                        <label class="form-check-label" for="sex0">
                            <input type="radio" name="sex" id="sex0" th:value="0"
                                   class="form-check-input" placeholder="性别"
                                   th:checked="${response.data.one?.sex == 0}"
                            />
                            未知
                        </label>
                    </div>
                    <div class="form-check form-check-inline">
                        <label class="form-check-label" for="sex1">
                            <input type="radio" name="sex" id="sex1" th:value="1"
                                   class="form-check-input" placeholder="性别"
                                   th:checked="${response.data.one?.sex == 1}"
                            />
                            男
                        </label>
                    </div>
                    <div class="form-check form-check-inline">
                        <label class="form-check-label" for="sex2">
                            <input type="radio" name="sex" id="sex2" th:value="2"
                                   class="form-check-input" placeholder="性别"
                                   th:checked="${response.data.one?.sex == 2}"
                            />
                            女
                        </label>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-8 col-sm-offset-2">
                    <button class="btn btn-md btn-primary" type="submit">提交</button>
                </div>
            </div>
        </form>
    </div>
</div>
<div th:replace="~{include/all_include::footer}"/>
</body>
</html>